import { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';

/**
 * flock模块-群信息
 */
@Entity('flock_info')
export class FlockInfoEntity extends BaseEntity {
  @Index()
  @Column({ comment: '支付名', length: 100 })
  payName: string;

  @Column({ comment: '名称', length: 100 })
  name: string;

  @Column({ comment: '描述', type: 'text', nullable: true })
  description: string;

  @Column({ comment: '头像', length: 255, nullable: true })
  avatar: string;

  @Column({ comment: '群二维码', length: 255})
  flockQrCode: string;

  @Column({ comment: 'qq群号码', length: 100, nullable: true })
  flockQrCodeNumber: string;

  @Column({ comment: '群成员', type: 'json', nullable: true })
  members: string[];

  @Column({ comment: '群评论', type: 'json', nullable: true })
  comments: string[];

  @Column({ comment: '群简介', type: 'text', nullable: true })
  summary: string;

  @Column({ comment: '阅读量', default: 0 })
  views: number;

  @Column({ comment: '收藏数', default: 0 })
  favorites: number;

  @Column({ comment: '点赞数', default: 0 })
  likes: number;

  @Column({ comment: '群成员数', default: 0 })
  flockNum: number;

  @Column({ comment: '单价', type: 'decimal', precision: 10, scale: 2 })
  price: number;

  @Column({ comment: '次日价', type: 'decimal', precision: 10, scale: 2 })
  nextDayPrice: number;

  @Column({ comment: '客服二维码', length: 255})
  serviceCode: string;

  @Column({ comment: '客服微信', length: 255})
  serviceNum: string;
}
